import com.sun.xml.internal.ws.api.model.wsdl.WSDLOutput;

import javax.crypto.spec.PSource;

class OuterClass{
    public int data1 = 1;
    private int data2 = 2;
    public static int data3 = 3;
    //静态内部类
    static class InnerClass{
        public int data4 = 4;
        private int data5  = 5;
        public static int data6 = 6;
        public void test(){
            System.out.println(new OuterClass().data1);
            System.out.println("");
        }
    }
//    //实例内部类，你可以把他当做是外部类的一个普通实例的成员
//    class InnerClass{
//        public int data1 = 555;
//        public int data4 = 4;
//        private int data5  = 5;
//        public static final int data6 = 6;
//        //
////        public static  int data7 = 6;  //显示报错，static属于类的，不属于对象的
//        public InnerClass(){
//            System.out.println("不需要带参数的内部类的构造方法");
//        }
//        public void test(){
//            System.out.println(OuterClass.this.data1);
//            System.out.println(this.data1);
//            System.out.println("  ");
//        }
//    }
}
class Tast{
    public void test(){
        System.out.println("test");
    }
}
public class TestDemo0826 {
    public static void main(String[] args) {
        new Tast(){
            @Override
            public void test() {
                System.out.println("hu");
            }
        }.test();

    }
    public void func(){
        class Test{
            public int a;
        }
        //缺点：只能在当前方法当中使用
    }


    public static void main1(String[] args) {
        OuterClass outerClass = new OuterClass();
        OuterClass.InnerClass innerClass = new OuterClass.InnerClass();
        innerClass.test();


    }
}
